/*
	mksure file is exist
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <error.h>
#include <stdlib.h>
const int SIZE = 1000;
int main(){
	//get output file
	FILE * f = fopen("job.lst","w");
	//set home dir
	char homedir[SIZE];
	if (getcwd(homedir,SIZE)==NULL){
		printf("getcwd error");
		exit(-1);
	}else{
		fprintf(f,"home %s\n",homedir);
	}
	//set problem id
	int probid = 1;
	char chp[SIZE];
	sprintf(chp,"p%04d",probid);
	fprintf(f,"probid %s\n",chp);
	fprintf(f,"src %s.cpp\n",chp);
	fprintf(f,"bin %s.o\n",chp);
	fprintf(f,"datin dat.in\n");
	fprintf(f,"datout dat.out\n");
	fprintf(f,"ans %s.out\n",chp);
	fprintf(f,"complie %ds\n",10);
	fprintf(f,"tl %ds\n",1);
	fprintf(f,"ml %dKB\n",65535);
	fflush(f);
	fclose(f);
	return 0;
}
